package 课堂;

/**
 * Created By  醉美柳舞之众星捧月
 *
 * @author song
 * @date 2017/11/10 17:09
 */
public class MyContainerIterator implements Iterator {
    private int current = 0;
    private MyContainer container;

    MyContainerIterator(MyContainer c) {
        container = c;
    }

    @Override
    public boolean hasnext() {
        return current < container.size;
    }

    @Override
    public Object next() {
        return container.items[current++];
    }
}
